package com.genexususa.eo.bing.data.wsSubclasses;

import com.genexususa.eo.bing.CampaignManagementServiceClasses.CityTarget;
import com.genexususa.eo.bing.CampaignManagementServiceClasses.CityTargetBid;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class GxCityTarget extends CityTarget {
    public GxCityTarget(Element element) {
        NodeList bidsNode = element.getElementsByTagName("CityTargetBidCollection");
        if (bidsNode.getLength() > 0) {
            NodeList cityTargetBidNode = ((Element)bidsNode.item(0)).getElementsByTagName("CityTargetBid");
            CityTargetBid[] cityTargetBids = new CityTargetBid[cityTargetBidNode.getLength()];
            for (int temp = 0; temp < cityTargetBidNode.getLength(); temp++) {
                cityTargetBids[temp] = new GxCityTargetBid((Element)cityTargetBidNode.item(temp));
            }
            this.setBids(cityTargetBids);
        }
    }
}
